package top.toptimus.dto.dropDownList;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.util.ValueUtil;

import java.util.Map;

/**
 * 下拉选择DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SimpleDropDownDTO {
    private String id;
    private String name;

    public SimpleDropDownDTO(Map<String, Object> stringObjectMap) {
        this.id = stringObjectMap.containsKey("id") ? ValueUtil.objectToSting(stringObjectMap.get("id")) : "";
        this.name = stringObjectMap.containsKey("name") ? ValueUtil.objectToSting(stringObjectMap.get("name")) : "";
    }
}
